<?php
    //连接数据库
    include("config/config.php");
    //获取前6本小说数据
    $novel=$dbh->query("SELECT * FROM novel LIMIT 6")->fetchAll();
?>


<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>小说馆</title>
		<link rel="stylesheet" type="text/css" href="statics/css/slider.css" />
        <link rel="stylesheet" type="text/css" href="statics/css/style.css">
        <link rel="stylesheet" type="text/css" href="css/style1.css"/>
		<script src="statics/js/jquery.min.js"></script>
	</head>

	<body>

    <!-- 头部 -->
        <?php
            include("template/head.php");
        ?>
    <!-- 头部 -->
        
	<!--导航-->
        <?php
            include("template/nav.php");
        ?>
    <!--导航-->
		<!--轮播部分-->
		<div class="slider">
			<div id="slideBox" class="slideBox">
				<div class="hd">
					<ul>
						<li></li>
						<li></li>
						<li></li>
						<li></li>
						<li></li>
						<li></li>
					</ul>
				</div>
				<div class="bd">
					<ul>
						<li><img src="statics/images/slider1.jpg" /></li>
						<li><img src="statics/images/slider2.jpg" /></li>
						<li><img src="statics/images/slider3.jpg" /></li>
						<li><img src="statics/images/slider4.jpg" /></li>
						<li><img src="statics/images/slider5.jpg" /></li>
						<li><img src="statics/images/slider6.jpg" /></li>
					</ul>
				</div>
			</div>
		</div>
		<!--轮播结束-->
		<script src="statics/js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
		<script src="statics/js/jquery.SuperSlide.2.1.1.js" type="text/javascript" charset="utf-8"></script>
		<script>
			//轮播
			jQuery(".slideBox").slide({
				mainCell: ".bd ul",
				effect: "left",
				autoPlay: true
			});
		</script>
        
<div id="new_box">

	<div class="title_cn">
		<img src="statics/images/tle_bt5.png" width="166" height="41">
	</div>
	
<div class="main">
	<div class="dy-content">
		<div class="dy-videos">
			<ul class="dy-video-list">
            <?php
                //展示小说
                $i=0;
                foreach ($novel as $value) {
                    $i++;
                    $show='dy-video-meta-right';
                    if($i%6==5 || $i%6==0 ){
                        $show='dy-video-meta-left';
                    }
                    echo '
                    <li data- class="dy-video-item '.$show.'">
                    <div class="dy-video-meta">
                        <div class="dy-video-meta-bg">
                        </div>
                        <div class="dy-video-meta-dy">
                            <h4 class="dy-video-title">
                            <a>
                            '.$value['name'].'
                            </a>
                            </h4>
                            <span class="dy-video-rating">'.$value['hot'].'</span>
                            <ul class="dy-video-meta-list">
                                <li class="dy-video-actors">
                                <span class="dy-video-tip">
                                    作者:
                                </span>
                                <a>'.$value['author'].'</a>
                                </li>
                                <li class="dy-video-types">
                                <span class="dy-video-tip">类型:</span>
                                <span class="dy-video-meta-filter">'.$value['type'].'</span>
                                </li>
                                <li class="dy-video-areas">
                                <span class="dy-split">|</span>
                                <span class="dy-video-tip">连载状态:</span>
                                <span class="dy-video-meta-filter">'.$value['status'].'</span>
                                </li>
                                <li class="dy-video-starts">
                                <span class="dy-split">|</span>
                                <span class="dy-video-tip">出版:</span>
                                <span class="dy-video-meta-filter">'.$value['publish'].'</span>
                                </li>
                            </ul>
                            <p class="dy-video-intro">
                            '.$value['content'].'
                                <a class="dy-video-intro-more">更多</a>
                            </p>
                        </div>
                        <div class="dy-video-meta-bg">
                        </div>
                    </div>
                    <div class="dy-video-poster">
                        <a class="dy-video-link" href="novel.php?name='.$value['name'].'">
                        <img class="dy-video-img" src="'.$value['img'].'" alt="'.$value['name'].'">
                        <span class="dy-video-nocomplete"></span>
                        <span class="dy-video-date">
                        '.$value['publish'].' 年
                        </span>
                        <span class="dy-video-bg"></span>
                        <span class="s-pay"></span>
                        </a>
                    </div>
                    <div class="dy-video-primary">
                        
                        <h4 class="dy-video-title"><a>
                        '.$value['name'].'
                        </a>
                        </h4>
                        <span class="dy-video-rating">
                        '.$value['hot'].'
                        </span>
                    </div>
                </li>
                    ';
                }
            ?>
		</ul>
</div>
</div>
        <!-- 脚部 -->
        <?php
            include("template/foot.php");
        ?>
    <!-- 脚部 -->

</body>
<script>
    //导航添加高亮
    $("#home").addClass("current");
</script>
</html>